<%-- 
    Document   : review
    Created on : Dec 26, 2009, 11:05:48 PM
    Author     : Administrator
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<table style="width: 600px;">
    <tr><td>
            <table border="1">
                <tr>
                    <td>Login Identity</td><td>${test.loginIdentity}</td>
                </tr>
                <tr>
                    <td>Login Password</td><td>${test.loginPassword}</td>
                </tr>
                <c:if test="${test.finished}">
                    <tr>
                        <td>Start time</td><td><fmt:formatDate value="${test.startTime}" pattern="hh:mm, MMM-d, yyyy"/></td>
                    </tr>
                    <tr>
                        <td>End time</td><td><fmt:formatDate value="${test.endTime}" pattern="hh:mm, MMM-d, yyyy"/></td>
                    </tr>
                </c:if>
                <c:if test="${!test.finished}">
                    <tr>
                        <td colspan="2">The test is not finished</td>
                    </tr>
                </c:if>
            </table>
        </td></tr>
        <c:forEach var="testItem" items="${test.testItems}" varStatus="counter">
        <tr style="border: solid 1px;"><td>
                <table style="width: 100%;">
                    <tr>
                        <td colspan="${testItem.question.options.size$}"><p>Question #${counter.count}: ${testItem.question.content}</p></td>
                    </tr>
                    <tr>
                        <c:forEach var="option" items="${testItem.question.options}" varStatus="counter">

                            <td>
                                <input type="radio" name="t${testItem.autoId}" id="radio" value="${counter.count}" />
                                <span
                                    <c:if test="${testItem.answered && (testItem.answer eq counter.count)}">
                                        <c:if test="${option.correct}"> style="color:green" </c:if>
                                        <c:if test="${!option.correct}"> style="color:red" </c:if>
                                    </c:if>
                                    >
                                    <span <c:if test="${option.correct}"> style="font-weight: bold" </c:if>>${option.content}</span>
                                </span>
                            </td>
                        </c:forEach>
                    </tr>
                </table>
            </td>
        </tr>
    </c:forEach>
    <tr><td>
            <em><strong>Notice: </strong>
                Correct answers are <strong>bolden</strong>;
                Student selected answer which is CORRECT is displayed in <span style="color:green">GREEN</span>;
                Student selected answer which is INCORRECT is displayed in <span style="color:red">RED</span>;
            </em>
        </td></tr>
</table>